using System;
using System.Collections;
using System.Runtime.CompilerServices;
using Nsb;
using Nsb.Classes;
using jQueryApi;

public static class CssWriterOptions
{
    internal static readonly Dictionary Dict = new Dictionary();
    
}

[Mixin("jQuery.fn")]
public static class CssWriterPlugin
{

    public static jQueryObject AddClassW(string classNames)
    {

        return jQuery.Current.Each(
            delegate
            {
                string name = ((string)Script.Literal("{0}.replace(/\\s+/, ' ')", classNames)).Split(" ")[0];
                if (!CssWriterOptions.Dict.ContainsKey(name) && name.Substr(0, Cluster.ClassNamePrefix.Length) != Cluster.ClassNamePrefix)
                {
                    Inform.Log(".{0}\n{{\n\n}}", name);
                    CssWriterOptions.Dict[name] = true;
                }
                jQuery.This.AddClass(classNames);
            });
    }
}

#region Script# Support

[Imported]
public sealed class CssWriter : jQueryObject
{
    public jQueryObject AddClassW()
    {
        return null;
    }

    public jQueryObject AddClassW(string classNames)
    {
        return null;
    }
}

#endregion